package model

import "gorm.io/gorm"

type Comment struct {
	gorm.Model
	UserId  int64  `gorm:"type:int;not null;commit:'用户Id'"`
	GoodId  int64  `gorm:"type:int;not null;commit:'商品Id'"`
	ZhuBoId int64  `gorm:"type:int;not null;commit:'主播Id'"`
	Comment string `gorm:"type:varchar(150);not null;commit:'评论内容'"`
}

func (c *Comment) CreateComment(db *gorm.DB) error {
	err := db.Create(&c).Error
	return err
}
